/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package traitements;

import bdd.QueriesCommandes;
import beans.CmdCommande;
import beans.CmdCommandesJoin;
import beans.CmdDetailCmde;
import beans.CmdLignesCmde;
import beans.DetailCommande;
import java.beans.*;
import java.io.Serializable;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * Vincent
 */
public class Commande implements Serializable {
    
    ArrayList <CmdCommande> commandes;
    ArrayList<CmdDetailCmde> detailCmde;
    
    public Commande(){
        commandes=new ArrayList();
    }
    
    
    public ArrayList<CmdCommande> listeCommandes(int cliId){
        
        QueriesCommandes qc;
        try {
            qc = new QueriesCommandes();
            commandes=qc.cmdAfficherCommandes(cliId);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Commande.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Commande.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        
        
        
        return commandes;
}
    
    public ArrayList<CmdDetailCmde> detailCommandes(int cmdId){
        
        
        QueriesCommandes qc;
        try {
            qc=new QueriesCommandes();
            detailCmde=qc.cmdAfficherLignesCmde(cmdId);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Commande.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(Commande.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    
        return detailCmde;
}
    
    
}
